typedef unsigned char      BYTE;
typedef unsigned int       UINT;

sbit UP_DOWN = P1^3;

#define PA_8255               XBYTE[0xE000]
#define PB_8255	              XBYTE[0xE001]
#define PC_8255               XBYTE[0xE002]
#define Control_8255          XBYTE[0xE003]
#define FLASH_CS              0xFF      	/*Flash CS pin select signal*/

void Erase_Entire_Chip(UINT);
void Erase_One_Sector(BYTE, UINT);
void Erase_Sector_ByNumb(UINT Sector_Numb);
void Flash_Write(BYTE, BYTE, UINT);
BYTE Flash_Read(BYTE, UINT);

void Flash_Write_Byte(UINT mData, UINT Sector_Numb, BYTE offset);
BYTE Flash_Read_Byte(UINT Sector_Numb, BYTE offset);

void Flash_Write_Bytes(BYTE* Data_Addr, BYTE n, UINT Sector_Numb, BYTE offset);
void Flash_Read_Bytes(BYTE* Data_Addr, BYTE n, UINT Sector_Numb, BYTE offset);

void Flash_Delay_ByteProgram();
void Flash_Delay_EraseChip();
void Flash_Delay_EraseSector();
void Flash_Delay_1ms(BYTE);
